pyGIMLi

Geophysical modeling and inversion beyond the standard

Carsten Rücker

TU Berlin, Germany

Thomas Günther

LIAG, Hannover, Germany

Florian Wagner

RWTH Aachen University, Germany

2024-03-19

pyGIMLi is a versatile open-source toolbox with:

  • management tools for structured and unstructured meshes in 2D & 3D
  • computationally efficient finite-element and finite-volume solvers
  • various geophysical forward operators: ERT/IP, Traveltime, Gravimetry, Magnetics, SP
  • Gauss-Newton based frameworks for constrained, joint and process-based inversions with region-specific regularization
  • open-source, platform compatible, documented & tested code
  • suitability for teaching & reproducible research
  • 1.0 version published in 2017 in Computers and Geosciences (Rücker, Günther, and Wagner 2017) (and among the Most Downloaded papers since, > 330 citations, > 100 uses in peer-reviewed papers)

pyGIMLi aims to make:

  • the easy things easy
  • the hard things possible
  • everything transparent and reproducible

Previous tutorials

  • Transform 2021 has discussed creating geometries & meshes, the modeling level and synthetic data creation as well as inversion (with external forward operators).
  • Transform 2022 has discussed fundamental pyGIMLi objects (Mesh, DataContainer, matrix types, etc.), geostatistical vs. smoothness-constrained regularization and individual treatment of subsurface regions.
  • Today we will show you how to invert a real-life 3D data set (Hübner et al. 2017) with many ways to tweak your inversion beyond the standard practice.

What is new since?

  • All Transform ’21 & ’22 notebooks available as tutorials or examples on pygimli.org
  • Improved 3D visualization powered by pyvista (including filters, slices and interactive notebook compatibility)
  • 3D gravity and (full-tensor) magnetics operators and managers
  • New matrices and matrix generators, e.g. non-explicit (PDE-based) Jacobian matrix
  • LSQR-inversion framework allowing parameter constraints (from Wagner et al. 2019)
  • Multi-frame modelling framework for temporally/spectrally/spatially constrained inversion
  • TimelapseERT class
  • Many new examples on ERT (2D/3D crosshole, 3D surface, timelapse) & IP, 3D magnetics
  • Improved website, i.e. fully upgraded to modern (pg>1.2) style and moved to the pydata-sphinx-theme
  • Many more convenience functions
  • Many new papers using pyGIMLi (https://pygimli.org/publist.html)

Join the pyGIMLi user community!

“In open source, we feel strongly that to really do something well, you have to get a lot of people involved.”

– Linus Torvalds

  1. Join the #pyGIMLi chat on Mattermost!
  2. Open a discussion or an issue on GitHub.
  3. Contribute to the website via the “Improve this page” button in the right sidebar.
  4. Add your pyGIMLi-powered publication to this file.
  5. Send your example to mail@pygimli.org.
  6. Contribute to the code as described in our contribution guidelines.

How to get started

  1. Open the Anaconda Prompt () or a Terminal (/).
  2. Clone the SEGwebinar repository.
git clone https://github.com/gimli-org/SEGwebinar.git
cd SEGwebinar
  1. Install the pg environment with the required dependencies (in particular pygimli=1.5.0).
conda env create
  1. Activate the environment and start a Jupyter Notebook.
conda activate pg
jupyter notebook

Follow without a local installation

You can also visit https://colab.research.google.com, open an empty notebook and type !pip install pygimli.

Let’s go!

Source: Hübner et al. (2017)
Hübner, R., T. Günther, K. Heller, U. Noell, and A. Kleber. 2017. “Impacts of a Capillary Barrier on Infiltration and Subsurface Stormflow in Layered Slope Deposits Monitored with 3-d ERT and Hydrometric Measurements.” Hydrology and Earth System Sciences 21 (10): 5181–99. https://doi.org/10.5194/hess-21-5181-2017.
Rücker, C., T. Günther, and F. M. Wagner. 2017. pyGIMLi: An Open-Source Library for Modelling and Inversion in Geophysics.” Computers and Geosciences 109: 106–23. https://doi.org/10.1016/j.cageo.2017.07.011.
Wagner, F. M., C. Mollaret, T. Günther, A. Kemna, and C. Hauck. 2019. “Quantitative Imaging of Water, Ice, and Air in Permafrost Systems Through Petrophysical Joint Inversion of Seismic Refraction and Electrical Resistivity Data.” Geophysical Journal International 219 (3): 1866–75. https://doi.org/10.1093/gji/ggz402.